﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsFormsApplication1
{
    class Person
    {
        public string name;          //姓名：公有字段，能被继承
        private int age;	            //年龄：私有字段，不被继承
        protected string Sex;       //性别：保护成员
        public Person(string n, int a, string s)//构造函数, 不能被子类继承
        { name = n; age = a; Sex = s; }

        public string WriteAge() 	//公有成员方法
        {
            return age.ToString();
        }
        public string Display()
        {
            return name + age.ToString() + Sex;
        }


    }
}
